//
//  UploadFormVC.m
//  MyDemo
//
//  Created by macOS on 2016/12/6.
//  Copyright © 2016年 macOS. All rights reserved.
//

#import "UploadFormVC.h"
#import "UploadPicVC.h"
#import "DemoBtn.h"
#import "LoginVC.h"
#import "Singleton.h"
@interface UploadFormVC ()
@property (nonatomic, strong) Singleton *center;
@property (nonatomic, strong) LoginVC *lvc;
@end

@implementation UploadFormVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self.view setBackgroundColor:[UIColor whiteColor]];
    
    _center = [Singleton sharedSingleton];
    //[self.navigationController setNavigationBarHidden:YES animated:NO];
    DemoBtn *btn = [DemoBtn buttonWithTitle:@"上传查验单"];
    
    [btn addTarget: self action:@selector(confirm) forControlEvents:UIControlEventTouchUpInside];
    

    btn.frame = CGRectMake(kScreenWidth/2 -100/2, kScreenHeight /2 -44, 100, 44);
    
    
    [self.view addSubview:btn];
 
    
    
    
   
}




- (void)confirm{
    
    if (_center.isLogin) {
        [self.navigationController pushViewController:[UploadPicVC new] animated:YES];
    }else{
        _lvc = [LoginVC new];
        [self presentViewController:_lvc animated:YES completion:nil];
    }
    
}



@end
